package com.mall.sun.controller;

import com.mall.sun.model.vo.ResultVO;
import com.mall.sun.service.GoodscategoryService;
import com.mall.sun.utils.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:  <br>
 * date: 2021/12/11 22:36 <br>
 * author: ztz <br>
 * version: 1.0 <br>
 */
@RestController
@RequestMapping("/category")
public class GoodsCategoryController {
    @Autowired
    GoodscategoryService goodscategoryService;

    @GetMapping("/count")
    public ResultVO countCategory(){
        return CommonUtil.ajaxReturn(goodscategoryService.countCategory());
    }

    @GetMapping("/all")
    public ResultVO getAll(){
        return CommonUtil.ajaxReturn(goodscategoryService.getAll());
    }
    @GetMapping("/countCategory")
    public ResultVO countCategoryGood(){
        return CommonUtil.ajaxReturn(goodscategoryService.countGoodCategory());
    }
}
